package JAVATest;

import java.util.Random;
import java.util.Scanner;

/**
 * ClassName:Text_011
 * Package:JAVATest
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/12-19:12
 * @Version:v1.0
 */
public class Text_011 {
    //开发验证码！！！！！
    //长度为5，前四位是大写字母或者小写字母，最后一位是数字
    //A~Z 65-90
    //a~z 97-122
    public static void main(String[] args) {
        extracted();
        System.out.print("请输入验证码:");
        Scanner sc = new Scanner(System.in);
        String str=sc.nextLine();
    }

    public static void extracted() {
        char[] chs = new char[52];
        for (int i = 0; i < chs.length; i++) {
            if (i <= 25) {
                chs[i] = (char) (97 + i);
            } else {
                chs[i] = (char) (65 + i - 26);
            }
        }
        String result="";
        Random r = new Random();
        for (int i = 0; i < 4; i++) {
            int randomIndex = r.nextInt(chs.length);
            result=result+chs[randomIndex];
        }
        int number=r.nextInt(10);
        result+=number;
        System.out.println(result);
    }

}
